#include "PDTCodeGraph.h"


#include "PDTNumVar.h"
#include "PDTExpNumBinDerived.h"
#include "PDTAssign.h"
#include "PDTListOfStatements.h"
#include "PDTWhile.h"
#include "PDTExpBoolBinNumDerived.h"
#include "PDTExpBoolBinBoolDerived.h"
#include "PDTNot.h"
#include "PDTGraphVisitor.h"
#include "PDTIfElse.h"
#include "PDTNumConst.h"
#include "PDTBoolVar.h"
#include "PDTBoolConst.h"
#include "PDTNeg.h"
#include "PDTFunction.h"

#include <iostream>
using namespace std;
int main2 ()

{

PDTCodeGraph CG;
PDTNumVar a(CG,"a");

PDTNumVar b(CG,"b");
PDTBoolVar bv(CG,"bv");
PDTNumConstInt const1(CG,2);
PDTBoolConst bc(CG,true);

PDTAdd add1(CG,a,b);

PDTAssign assign1(CG,a,add1);
PDTAssign assign2(CG,a,const1);
PDTNeg neg1(CG,b) ;
PDTLessThanEqual less1(CG,a,neg1);
PDTEqualBool equal1(CG,bv,bc);
PDTAnd and1(CG,equal1,less1);
PDTNot not1 (CG,and1);

PDTIfElse ifelse2(CG,less1,assign1,assign2);
PDTIfElse ifelse(CG,not1,assign1,ifelse2);



vector<PDTStatement*> slist;
slist.push_back(&assign1);
slist.push_back(&assign2);
//slist.push_back(&ifelse);

PDTListOfStatements list(CG,slist);
PDTWhile while1(CG,not1,list);

PDTYicesVisitor gvy(CG);
PDTDefaultVisitor gvd;
vector<PDTVar*> arguments;
arguments.push_back(&b);
string fnname="ui";
PDTFunctionDec func1(CG,fnname,list,a,arguments);

func1.traverse(gvy);

return 1;

}
